﻿using System.Collections.Generic;
using System.Linq;

namespace Z.GenerateIconProject.WinForm.BL
{
    public partial class ApplicationConfiguration
    {
        public List<ApplicationProject> GetLastAccessProjects(int top)
        {
            List<ApplicationProject> projects = Projects.Where(x => x.ProjectPath.ToDirectoryInfo().Exists)
                .OrderByDescending(x => x.LastAccessTime)
                .Take(top)
                .ToList();

            return projects;
        }
    }
}